<?php
// .-----------------------------------------------------------------------------------
// | WE TRY THE BEST WAY 杭州博也网络科技有限公司
// |-----------------------------------------------------------------------------------
// | Author: 贝贝 <hebiduhebi@163.com>
// | Copyright (c) 2013-2016, http://www.itboye.com. All Rights Reserved.
// |-----------------------------------------------------------------------------------

namespace app\admin\controller;

use app\src\base\helper\ValidateHelper;
use app\src\i18n\logic\OrgMemberLogic;
use app\src\log\logic\ExchangeLogLogic;
use app\src\message\logic\MessageLogic;
use app\src\order\action\OrderBackAction;
use app\src\order\action\OrderConfirmAction;
use app\src\order\action\OrderShippedAction;
use app\src\order\logic\OrdersCommentLogic;
use app\src\order\logic\OrdersContactinfoLogic;
use app\src\order\logic\OrdersReFundLogic;
use app\src\order\model\OrdersExpress;
use app\src\platform\logic\PlatformLogic;
use app\src\system\logic\CityLogic;
use app\src\system\logic\DatatreeLogicV2;
use app\src\system\logic\ProvinceLogic;
use app\src\user\action\RelationAction;
use app\src\user\logic\UserMemberLogic;
use app\src\user\logic\UserRelationLogic;
use think\Log;
use app\src\order\logic\OrdersLogic;
use app\src\order\logic\OrdersInfoViewLogic;
use app\src\order\logic\OrderStatusHistoryLogic;
use app\src\goods\logic\ProductFaqLogic;
use app\src\order\logic\OrdersItemLogic;
use app\src\order\logic\OrdersExpressLogic;
use app\src\user\logic\MemberLogic;
class Relation extends Admin{

    //关系首页
    public function show(){
        $group_type=input('u_group','');
        $uid=UID;
//        $relation=(new UserRelationLogic())->queryNoPaging(['upper_uid'=>$uid]);
//        if(!$relation['status']||empty($relation['info'])) $this->error('获取关系出错');
//        foreach($relation['info'] as $k=>$v){
//            $lower[]=$v['lower_uid'];
//            $lower=(new MemberLogic())->getInfo(['uid'=>$v['lower_uid']]);
//        }

        if(!empty($group_type)){
            $type=$group_type;
        }else{
            $type='';
        }

        $plat_id=(new PlatformLogic())->getInfo(['id'=>$uid]);
        $plat_ids=(new PlatformLogic())->queryNoPaging([]);
        $uid=$plat_id['info']['uid'];

        if(UID==1){
            $ids='-1';

            foreach($plat_ids['info'] as $v){
                $ids=$ids.','.$v['uid'];
            }
            $uid=['in',$ids];
        }


        $relation=(new UserRelationLogic())->relation_detail($uid,$type);

        if(!$relation['status']) $this->error('查询出错');
        $this->assign('info',$relation['info']);
        $this->assign('type',0);
        return $this->boye_display();

    }
}